import numpy as np
import matplotlib.pyplot as plt


# 2.1
# score = [10, 51, 96, 94, 61, 61, 85, 62, 78, 48, 59, 49, 56, 12, 47, 59, 36, 15, 36, 54, 78, 45, 9, 66, 19, 29, 49, 45,
#          98, 25, 4, 65, 8, 41, 5, 96, 2, 4, 4, 54, 97, 16, 9, 16, 94, 16, 59, 5, 4, 85, 84, 102, 106, 128, 92, 81, 63,
#          82, 73, 19, 64, 7, 2, ]
# plt.rcParams['font.sans-serif'] = ['SimHei']
# plt.xlabel('分数')
# plt.ylabel('学生数量')
# plt.title('学生语文成绩分布直线图')
# plt.hist(score, bins=range(0, 150, 10), facecolor='red', edgecolor='black')
# plt.show()
2.2
# arr1 = np.array([1.1,2.2,3.3])
# print('一维数据组arr1: \n', arr1)
# arr2 = np.array((-1,-2,-3), dtype='int32')
# print('一维数据组arr2：\n', arr2)
# # arr3 = np.array([[1, 2, 3, ], [4, 5, 6], [7, 8, 9]], dtype='float32')
# # print('二维数据arr3：\n', arr3)
# arr4 = np.array((3,-2,2.3), dtype='int32')
# print('一维数据组arr2：\n', arr4)


#
# arr1 = np.zeros(2)
# print('一维数据组arr1: \n', arr1)
# arr2 = np.zeros((2,3), dtype='int32')
# print('一维数据组arr2：\n', arr2)
# arr3 = np.ones(3)
# print('二维数据arr3：\n', arr3)
# arr4 = np.ones((3,3))
# print('一维数据组arr2：\n', arr4)
# arr5 = np.empty(4)
# print('一维数据组arr1: \n', arr1)
# arr6 = np.empty((3,4))
# print('一维数据组arr2：\n', arr2)

arr7 = np.ones ((2, 3),)*5
print('一维数据组arr1: \n', arr7)
